package com.shimao.celnet.payment.util;


import com.shimao.celnet.payment.model.ASysUser;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

/**
 * Created by ensure on 2017/4/20.
 */
public class PasswordHelper {
	public void encryptPassword(ASysUser user) {
		String newPassword = new SimpleHash(
				FinalUtil.ALGORITHM_NAME, user.getPassword(),
				ByteSource.Util.bytes(user.getUserName()),
				FinalUtil.HASH_INTERATIONS).toHex();
		user.setPassword(newPassword);

	}

}
